package com.wsc.controller;

import com.wsc.dao.BookMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RequestMapping("book")
@RestController
public class BookController {
    @Resource
    BookMapper bookMapper;
    @Resource
    RestTemplate restTemplate;
    @RequestMapping("select")
    public Object select(){
        return "这是back的"+bookMapper.selectList(null);
    }

    @RequestMapping("test")
    public String test()
    {
        String result = restTemplate.getForObject("http://orderService/order/select", String.class);
        return "Return : " + result;
    }

}
